// Matrix.h: interface for the CMatrix class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MATRIX_H__DCBCF315_0AE9_4D71_8662_B47C1EFA0552__INCLUDED_)
#define AFX_MATRIX_H__DCBCF315_0AE9_4D71_8662_B47C1EFA0552__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "dcl_ModelObj.h"

class DEF_MODELOBJ CMatrix  
{
public:
	CMatrix();
	virtual ~CMatrix();

public:
	//CMatrix DotProduct(const CMatrix & mat) const;
	CMatrix CrossProduct(const CMatrix & mat) const;
	void TransformPoint(double x, double y, double & new_x, double & new_y) const;
	void TransformVector(double x, double y, double & new_x, double & new_y) const;
	void TransformAngle(double angle, double & new_angle);
	void TransformLength(double dblWidth, double & dblNewWidth) const;
	void TransformHeight(double dblHeight, double & dblNewHeight) const;
	bool SetValue(int i, int j, double dblValue);
	bool GetValue(int i, int j, double & dblValue) const;
	double GetValue(int i, int j) const;
	void Get3Dtransf(float* float_mat); 
	bool IsSameMatrix(CMatrix A);
public:
	static CMatrix Identity();
	static CMatrix Translation(double dblOffsetX, double dblOffsetY);
	static CMatrix Rotation(double dblOriginX, double dblOriginY, double dblAngle);
	static CMatrix Scale(double dblBaseX, double dblBaseY, double dblXScale, double dblYScale);
	static CMatrix Mirror(double dblOriginX, double dblOriginY, double dblDirX, double dblDirY);
	static CMatrix Transf3Dto2D(float* float_mat);
	static CMatrix Inverse(CMatrix & mat);
	static double AngleBetween(double x1, double y1, double x2, double y2);
	static void GetInverse(float* float_mat, float* float_Inv);
	static double Pi;

protected:
	double Angle(double x1, double y1);

protected:
	double m_Data[3][3];
};

#endif // !defined(AFX_MATRIX_H__DCBCF315_0AE9_4D71_8662_B47C1EFA0552__INCLUDED_)
